-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[elasticsearch] cleanup remaining pv(c) after goss tests #336
Conversation
elasticsearch/examples/6.x/Makefile
Outdated
@@ -13,3 +13,4 @@ test: install goss | |||
|
|||
purge: | |||
helm del --purge $(RELEASE) | |||
for pvc in $$(kubectl get pvc -o name | grep $(RELEASE)); do kubectl delete $$pvc; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grep is potentially dangerous since it will match partial release names. If someone has a release called elasticsearch
it will delete all PVCs with elasticsearch
in the name. Is it possible to do this based on labels like this?:
helm-charts/helpers/examples.mk
Lines 3 to 7 in 340868c
GOSS_SELECTOR ?= release=$(RELEASE) | |
STACK_VERSION := 7.4.0 | |
goss: | |
GOSS_CONTAINER=$$(kubectl get --no-headers=true pods -l $(GOSS_SELECTOR) -o custom-columns=:metadata.name | sed -n 1p ) && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 1e5616b
elasticsearch/examples/6.x/Makefile
Outdated
@@ -13,3 +13,4 @@ test: install goss | |||
|
|||
purge: | |||
helm del --purge $(RELEASE) | |||
for pvc in $$(kubectl get pvc -o name | grep $(RELEASE)); do kubectl delete $$pvc; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the pvc
part is missing here.
for pvc in $$(kubectl get pvc -o name | grep $(RELEASE)); do kubectl delete $$pvc; done | |
for pvc in $$(kubectl get pvc -o name | grep $(RELEASE)); do kubectl delete pvc $$pvc; done |
You could also drop the for loop and just do kubectl delete pvc $$(kubectl get pvc -o name | grep $(RELEASE))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the pvc part is missing here.
Actually with the -o name
, k8s resources are already prefixed by their kind:
$ kubectl get pvc -o name | grep helm-logstash-oss
persistentvolumeclaim/helm-logstash-oss-logstash-helm-logstash-oss-logstash-0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also drop the for loop and just do
kubectl delete pvc $$(kubectl get pvc -o name | grep $(RELEASE))
Nice I didn't know kubectl delete
could accept more than one resource in argument, I prefer avoiding the for
loop if needed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 1e5616b
703692a
to
1e5616b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
`release` label need to be added StatefulSet `spec.selector.matchLabels` to be included in pvc so we can select only pvc matching release
1e5616b
to
0a9304e
Compare
jenkins test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
jenkins test this please |
1 similar comment
jenkins test this please |
@@ -18,6 +18,7 @@ spec: | |||
selector: | |||
matchLabels: | |||
app: "{{ template "uname" . }}" | |||
release: {{ .Release.Name | quote }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like changing spec.selector.matchLabels
during statefulset upgrade is failing:
Error: UPGRADE FAILED: StatefulSet.apps "upgrade-master" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad that upgrade test is in there and caught that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems related to helm/charts#7680
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
4 similar comments
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
👍 |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
still valid |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
still valid |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. To track this PR (even if closed), please open a corresponding issue if one does not already exist. |
${CHART}/tests/*.py
${CHART}/examples/*/test/goss.yaml